<?php

namespace app\admin\validate;

use think\Validate;

class Overtime extends Validate
{

    /**
     * 验证规则
     */
    protected $rule = [
        'username' => 'require|max:50',
        'overtime_begin' => 'date',
        'overtime_end' => 'date',
        'userid'    => 'require',
        'reason'    => 'require',
    ];

    /**
     * 提示消息
     */
    protected $message = [
    ];

    /**
     * 字段描述
     */
    protected $field = [
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['username', 'userid', 'overtime_begin', 'overtime_end'],
        'edit' => ['username', 'userid', 'overtime_begin','overtime_end'],
    ];

    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'username' => __('Username'),
        ];
        parent::__construct($rules, $message, $field);
    }

}
